Basics of C Language

IMPORTANT

Basics of C Language: Overview

This topic covers concepts, such as Functions and Classes in C/C++, Programming in C/C++, Arithmetic Operator, Relational Operator, Logical Operator, Operators in C/C++, Functions in C/C++, Constant in C/C++, Assignment Operator, Putchar, etc.

Important Questions on Basics of C Language

HARD
IMPORTANT

 What will be the output of the following C code? 

If following commands are used to run(considering myfile exists)?
gcc -otest test.c
./test < myfile

#include <stdio.h>
    int main()
    {
        char c = 'd';
        putchar(c);
    }

HARD
IMPORTANT

What is the output of this program?

           
#include <stdio.h>
int demo()
{
  static int i = 0;  
  printf("%d ",i++);
}
int main()
{
  for(int j = 0 ; j < 5 ; j++ )
  {
      demo();
  }
}

HARD
IMPORTANT

 Predict the output of following program.

#include <stdio.h>

int main()
{
    int a=10;
    int b=2;
    int c;
    
    c=(a & b);
    printf("c= %d",c);
    
    return 0;
}

EASY
IMPORTANT

In C programming language, which of the following type of operators have the highest precedence?

EASY
IMPORTANT

Which among the following is NOT a logical or relational operator?

EASY
IMPORTANT

What is the result of logical or relational expression in C?

EASY
IMPORTANT

void main()

{

      int i=0,j-1,k=1,m;

      m= i++ || j++  || k++

      printf("%d %d %d %d", m, i, j, k)

}

EASY
IMPORTANT

 Which of the following is not a valid variable name declaration?

HARD
IMPORTANT

What will be the output of the following code snippet?

#include <stdio.h>
int main() {
    int a = 3, b = 5;
    int t = a;
    a = b;
    b = t;
    printf("%d %d", a, b);
   
}

EASY
IMPORTANT

Which is the part of the structure of a C program?

EASY
IMPORTANT

Which is Procedural Oriented language?

MEDIUM
IMPORTANT

Study the following statement
for i=3 ; i<15 ; i+=3
{Print f"%d'',i+++i;}
What will be the output?

MEDIUM
IMPORTANT

The following programme fragment
int a=4, b=6
print f"%d", a=b

MEDIUM
IMPORTANT

The following programme fragment
int a=4, b=6
print f"%d",a!=b

MEDIUM
IMPORTANT

The following programme fragment
for i=3 ; i<15 ; i+=3;
print f"%d",i;
result in :

MEDIUM
IMPORTANT

Study the following statement

Print f"%f",95

What will it print?

EASY
IMPORTANT

Study the following programme fragment

int i=263

putchar i

What it does?

EASY
IMPORTANT

From the following comments about the ++ operator, which are correct?